<#--打印对象-->
<#--<#macro dump object><#if object??><#if object?is_string>"${object!}"<#elseif object?is_number>${object}<#elseif object?is_boolean>${object?string('true','false')}<#elseif object?is_date_like>"<#if object?is_datetime>${object?datetime}<#elseif object?is_date_only>${object?date}<#elseif object?is_time>${object?time}</#if>"<#elseif object?is_hash_ex>{<#list object?keys as k>"${k}":<@dump object[k]/><#if k?has_next>,</#if></#list>}<#elseif object?is_enumerable>[<#list object as o><@dump o/><#if o?has_next>,</#if></#list>]</#if></#if></#macro>-->
<#--service对象初始化-->
<#macro initService>
<script type="text/javascript">
    var service = longController.createService('${ckey}');
    //S.page.size=3;
    LC.attach('${ckey}', service);
    $(document).ready(function (e) {
        LC.initToolbar({
            'new': LC.S.tools.toolNew,
            'detail': LC.S.tools.toolDetail,
            'remove': LC.S.tools.toolRemove,
            'flesh': LC.S.tools.toolFlesh
        });
        LC.S.fillQueryForm();
        LC.S.query();
    });
</script>
</#macro>
<#--树型service对象初始化-->
<#macro initTreeService>
<script type="text/javascript">
    var service = longController.createTreeService('${ckey}');
    //S.page.size=3;
    LC.attach('${ckey}', service);
    $(document).ready(function (e) {
        LC.S.fleshTree();
    });
</script>
</#macro>
<#--分页信息-->
<#macro pageList clusters>
    <#assign page=clusters.page>
<div class="page">
    <span class="pageleft">
        共<span>${page.sum}</span>条记录
        每页<input type="number" name="page.size" value="${page.size}" id="pageSize"
                 onChange="LC.S.page.changeSize(this.value)"
                 min="5" max="100"/>条
        共<span>${page.count}</span>页
        当前第<span>${page.index}</span>页
        本页<span>${clusters.list?size}</span>条记录
    </span>
    <span class="pageright">
        <a href="javascript:LC.goFirst()">首页</a>
        <a href="javascript:LC.goPrev()">上一页</a>
        <a href="javascript:LC.goNext()">下一页</a>
        <a href="javascript:LC.goEnd()">尾页</a>
        跳到<select id="pageIndex" onchange="LC.go(this.value)">
        <#list 1..page.count as n>
            <option value="${n}">${n}</option>
        </#list>
    </select>页
    </span>
</div>
<script type="text/javascript">
    LC.setPage({
        count:${page.count!0},
        index: ${page.index!1},
        size:${page.size!20},
        sum:${page.sum!0}
    });
    $('#pageIndex').val(${page.index});
</script>
</#macro>

<#--工具栏-->
<#macro toolbar>
<div class="toolbar"></div>
</#macro>

<#macro select data null="请选择" text="text" value="value" default=0>
<select name="type" class="selectmenu" style="width: 150px">
    <#if null?has_content>
        <option value="">${null}</option>
    </#if>
    <#list data as d>
        <option value="${d[value]}">${d[text]}</option>
    </#list>
</select>
</#macro>
<#macro selectText data selected text="text" value="value" >
<select name="type" class="selectmenu" style="width: 150px">
    <#list data as d>
        <#if d[value]==selected>${d[text]}</#if>
    </#list>
</select>
</#macro>